package com.noahplat.user.mapper;

import com.noahplat.user.pojo.Avatar;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * 头像关系映射表
 *
 * @author 李东
 * @version 1.0.0
 * @Date: 2021/3/13 9:28
 **/
public interface AvatarMapper extends Mapper<Avatar> {

    @Select("select id,title,image,create_time from tb_avatar where stid =#{stid} limit 1")
    public Avatar selectOneByStid(@Param("stid") Long stid);
    @Select("select a.id,a.title,a.image,a.stid,a.create_time as createTime,s.sys_name as sysname from tb_avatar a left join sys_type s on s.id = a.stid")
    public List<Avatar> getAvatar();

}
